//
//  SecondTableViewCell.m
//  UI_Homework_12
//
//  Created by 黄威 on 16/5/19.
//  Copyright © 2016年 黄威. All rights reserved.
//

#import "SecondTableViewCell.h"
@interface SecondTableViewCell()
@property (nonatomic,retain)UILabel *labelOftitle;
@property (nonatomic,retain)UILabel *labelOFcontect;

@end
@implementation SecondTableViewCell



- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{

    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        [self createSunviews];
        
    }

    return self;
}

- (void)setContect:(NSString *)contect{

    if (_contect != contect) {
        [_contect release];
        [contect retain];
        
        
    }
    self.labelOftitle.text = contect;

}


-(void)layoutSubviews{


    [super layoutSubviews];
    
    self.labelOftitle.frame = CGRectMake(10, 60, 200, 40);
    //self.labelOFcontect.frame = CGRectMake(10, 110, 200, 40);
   

}
- (void)createSunviews{

    self.labelOftitle = [[UILabel alloc]init];
    [self.contentView addSubview:self.labelOftitle];
    
//    self.labelOFcontect = [[UILabel alloc]init];
//    [self.contentView addSubview:self.labelOFcontect];
    
//    self.labelOFcontect.numberOfLines = 0;
    self.labelOftitle.numberOfLines = 0;


}

+ (CGFloat)heightForCellWithContect:(NSString *)text{

   CGRect rect = [text boundingRectWithSize:CGSizeMake(SCREEN_WIDTH - 10 - 10 - 10 - 60, 0) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:17]} context:nil];
    return rect.size.height;
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end


























